import React from "react";

const PrepareData = ({children,exampleField}: any) => {
    //类似权限控制
    const a = 2
   let c = <div>1</div>;
   if(a === 1){
    c = <div>2</div>
   }else{
    c = React.cloneElement(children, {
        newprops: 1,
        exampleField: exampleField
      });
   }
   return <>{c}</>
}

export default ( {children,exampleField}: any ) => {
   return(
    <PrepareData exampleField={exampleField}>
    {children}
    </PrepareData>
   ) 
}